package com.lin.activity;

import java.util.ArrayList;

import com.lin.fragments.PersonalDetailCardCallHistoryFragment;
import com.lin.fragments.PersonalDetailCardMSMAndCALLFragment;
import com.lin.fragments.SuperFriendDynamicFragment;
import com.lin.utils.Session;
import com.lin.utils.Session.ResultReceiver;
import com.lin.views.ListViewForFriendShare;
import com.lin.views.MyFragmentAdapter;
import com.yunfeng.supercall.R;
import com.yunfeng.supercall.activity.BaseActivity;
import com.yunfeng.supercall.activity.ShareActivity;
import com.yunfeng.supercall.bean.Constants;
import com.yunfeng.supercall.bean.FriendsShareBean;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.FrameLayout;
import android.widget.TextView;

public class EntrepriseDynamicActivity extends FragmentActivity implements Constants, OnClickListener{

	private int mOtherId;

	private FrameLayout mFrameLayoutMore;
	private FrameLayout mFrameLayoutBack;
	private ViewPager mViewPager;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_entreprise_dynamic);
		mViewPager = (ViewPager) findViewById(R.id.mainViewPager);
		mFrameLayoutMore = (FrameLayout) findViewById(R.id.framelayout_more);
		mFrameLayoutBack = (FrameLayout) findViewById(R.id.framelayout_back);
		
		int isFromEntreprise = getIntent().getIntExtra("from_entreprise", 0);
		if(isFromEntreprise == 1) {
			mFrameLayoutMore.setVisibility(View.GONE);	
		}
		
		mFrameLayoutBack.setOnClickListener(this);
		mFrameLayoutMore.setOnClickListener(this);
		
		mOtherId = getIntent().getIntExtra(KEY_DATA, BaseActivity.getUser(getApplicationContext()).getUserid());
/*		
 * 
 * 
		if (mOtherId == BaseActivity.getUser(getApplicationContext()).getUserid()) {
//			title.setText(R.string.my_share);
		} else if (mOtherId == -3) {
//			title.setText(R.string.enterprise_share);
		} else if (mOtherId == -2) {
//			title.setText(R.string.focused_share);
		} else if (mOtherId == -1) {
//			title.setText(R.string.fans_share);
		}*/
		
		
		SuperFriendDynamicFragment mSuperFriendDynamicFansFragment1 = new SuperFriendDynamicFragment();

		Bundle bundle = new Bundle();
		bundle.putInt(KEY_DATA, -3);
		mSuperFriendDynamicFansFragment1.setArguments(bundle);
		
		ArrayList<Fragment> mFragments1 = new ArrayList<Fragment>();
		mFragments1.add(mSuperFriendDynamicFansFragment1);
		MyFragmentAdapter mFragmentAdapter = new MyFragmentAdapter(getSupportFragmentManager(),
				mFragments1);
		
		mViewPager.setAdapter(mFragmentAdapter);
	}
	@Override
	public void onClick(View view) {
		// TODO Auto-generated method stub
		if(mFrameLayoutBack == view) {
			finish();
		} else if(mFrameLayoutMore == view) {
			Intent intent = new Intent(this, ShareActivity.class);
			startActivity(intent);
		} 
	}

	
	
	
	
}